package com.rfid.emergencywarehouse.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.rfid.base.base.BaseTitleFragment;
import com.rfid.emergencywarehouse.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SuccessFragment extends BaseTitleFragment {

    @BindView(R.id.success_tip)
    TextView mTipText;
    @BindView(R.id.view_new)
    Button mViewBtn;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_success,container,false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ButterKnife.bind(this,view);
        Bundle bundle = getArguments();
        if (bundle != null) {
            mTipText.setText(bundle.getString("tip",""));
            setTitle(bundle.getString("title"));
            mViewBtn.setText(bundle.getString("btn_txt",""));
        }
    }

    @OnClick({R.id.cancel})
    public void click(View v) {
        int id = v.getId();
        if (id == R.id.cancel) {
            getActivity().finish();
        }
    }

    @Override
    protected void onLeftTitleClick() {
        getActivity().finish();
    }
}
